#include <ballade/smartclient.h>

#include "reader_thread_test.h"

namespace Ballade
{
	namespace SmartClient
	{
		CPPUNIT_TEST_SUITE_REGISTRATION(ReaderThreadTest);

		void ReaderThreadTest::setUp()
		{
			_socket = new Network::Socket();
			_reader = new ReaderThread(*_socket);
		}

		void ReaderThreadTest::tearDown()
		{
			delete _reader;
			delete _socket;
		}

		void ReaderThreadTest::testStart()
		{
			_reader->start();
			CPPUNIT_ASSERT(!_reader->isTerminated());
			_reader->stop();
		}

		void ReaderThreadTest::testIsTerminated()
		{
			CPPUNIT_ASSERT(_reader->isTerminated());
		}
	}
}